<?php
/**
 * Created by PhpStorm.
 * User: AivyYuan
 * Date: 2016/7/12
 * Time: 17:28
 */
namespace app\models;

use yii\db\ActiveRecord;
class BlogContent extends ActiveRecord{
    public function rules()
    {
        return [
            [['content'],'required'],

        ];
    }
    public function getSubContent(){
        if($this->content){
            return substr($this->content, 0,100);
        }else{
            return '';
        }

    }
}